package cn.mengfly.testnrz.im.client.builder;

import cn.mengfly.testnrz.im.client.ClientSession;
import cn.mengfly.testnrz.im.ProtoMsg;

public class BaseBuilder {
    protected ProtoMsg.HeadType type;
    private ClientSession session;

    public BaseBuilder(ProtoMsg.HeadType type, ClientSession session) {
        this.type = type;
        this.session = session;
    }

    public ProtoMsg.Message buildCommon(long seqId) {
        ProtoMsg.Message.Builder mb = ProtoMsg.Message.newBuilder()
                .setType(type).setSessionId(session.getSessionId())
                .setSequence(seqId);
        return mb.buildPartial();
    }
}
